home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / vdl020d.zip / VPROC.DOC < prev    next >
Text File  |  1993-04-14  |  4KB  |  239 lines

  1. {
  2.  ════════════════════════════════════════════════════════════════════════════
  3.  
  4.  Visionix ExitProc Unit (VPROC)
  5.  Copyright 1991,92,93 Visionix
  6.  ALL RIGHTS RESERVED
  7.  
  8.  Manages an ExitProc Stack for easing the halting of a program.
  9.  
  10.  ────────────────────────────────────────────────────────────────────────────
  11.  
  12.  Revision history in reverse chronological order:
  13.  
  14.  Initials  Date      Comment
  15.  
  16.  ────────  ────────  ────────────────────────────────────────────────────────
  17.  
  18.  lpg       03/16/93  Added Source Documentation
  19.  
  20.  mep       02/11/93  Updated code for release - new names for functions.
  21.                      Cleaned up code for beta release
  22.  
  23.  jrt       02/08/93  Sync with beta 0.12 release
  24.  
  25.  mep       01/24/93  Initialized.
  26.  
  27.  ────────────────────────────────────────────────────────────────────────────
  28. }
  29.  
  30. Unit VProc;
  31.  
  32.  
  33. Type
  34.  
  35.   {---------------------------------}
  36.   { Generic types for PROCEDURE and }
  37.   { Pointer to procedure; used by   }
  38.   { isolation routines.             }
  39.   {---------------------------------}
  40.  
  41.   PProcCall = ^TProcCall;
  42.   TProcCall = PROCEDURE;
  43.  
  44.   {----------------------------------}
  45.   { Procedure stack types, used for  }
  46.   { the exit procedure stack at      }
  47.   { system shutdown                  }
  48.   {----------------------------------}
  49.  
  50.   PProcStack = ^TProcStack;
  51.   TProcStack = RECORD
  52.  
  53.     Proc : PProcCall;
  54.     Next : PProcStack;
  55.  
  56.   END;
  57.  
  58. Var
  59.  
  60.   ProcStack : PProcStack;
  61.  
  62. {────────────────────────────────────────────────────────────────────────────}
  63.  
  64. Procedure VProcPush(                   Proc      : PProcCall );
  65.  
  66. Procedure VProcPop(                    Proc      : PProcCall );
  67.  
  68. Function  VProcPopNext                                        : PProcCall;
  69.  
  70. Procedure VProcRemove(                 Proc      : PProcCall );
  71.  
  72. Procedure VProcRemoveAll;
  73.  
  74. Procedure VProcDoExit;
  75.  
  76. {────────────────────────────────────────────────────────────────────────────}
  77.  
  78.  
  79. ──────────────────────────────────────────────────────────────────────────────
  80.  
  81.  
  82. [FUNCTION]
  83.  
  84. Procedure VProcPush(                   Proc      : PProcCall );
  85.  
  86. [PARAMETERS]
  87.  
  88. Proc          Pointer to a procedure-type.
  89.  
  90. [RETURNS]
  91.  
  92. (None)
  93.  
  94. [DESCRIPTION]
  95.  
  96. This procedure pushs a far procedure onto the exit stack, which will be
  97. automatically called upon a program halt.
  98.  
  99. [SEE-ALSO]
  100.  
  101. [EXAMPLE]
  102.  
  103.  
  104. ──────────────────────────────────────────────────────────────────────────────
  105.  
  106.  
  107. [FUNCTION]
  108.  
  109. Procedure VProcPop(                    Proc      : PProcCall );
  110.  
  111. [PARAMETERS]
  112.  
  113. Proc          Pointer to a procedure-type.
  114.  
  115. [RETURNS]
  116.  
  117. (None)
  118.  
  119. [DESCRIPTION]
  120.  
  121. [SEE-ALSO]
  122.  
  123. [EXAMPLE]
  124.  
  125.  
  126. ──────────────────────────────────────────────────────────────────────────────
  127.  
  128.  
  129. [FUNCTION]
  130.  
  131. Function  VProcPopNext                                        : PProcCall;
  132.  
  133. [PARAMETERS]
  134.  
  135. (None)
  136.  
  137. [RETURNS]
  138.  
  139. [DESCRIPTION]
  140.  
  141. [SEE-ALSO]
  142.  
  143. [EXAMPLE]
  144.  
  145.  
  146. ──────────────────────────────────────────────────────────────────────────────
  147.  
  148.  
  149. [FUNCTION]
  150.  
  151. Procedure VProcRemove(                 Proc      : PProcCall );
  152.  
  153. [PARAMETERS]
  154.  
  155. Proc          Pointer to a procedure-type.
  156.  
  157. [RETURNS]
  158.  
  159. (None)
  160.  
  161. [DESCRIPTION]
  162.  
  163. [SEE-ALSO]
  164.  
  165. [EXAMPLE]
  166.  
  167.  
  168. ──────────────────────────────────────────────────────────────────────────────
  169.  
  170.  
  171. [FUNCTION]
  172.  
  173. Procedure VProcRemoveAll;
  174.  
  175. [PARAMETERS]
  176.  
  177. (None)
  178.  
  179. [RETURNS]
  180.  
  181. (None)
  182.  
  183. [DESCRIPTION]
  184.  
  185. [SEE-ALSO]
  186.  
  187. [EXAMPLE]
  188.  
  189.  
  190. ──────────────────────────────────────────────────────────────────────────────
  191.  
  192.  
  193. [FUNCTION]
  194.  
  195. Procedure VProcDoExit;
  196.  
  197. [PARAMETERS]
  198.  
  199. (None)
  200.  
  201. [RETURNS]
  202.  
  203. (None)
  204.  
  205. [DESCRIPTION]
  206.  
  207. [SEE-ALSO]
  208.  
  209. [EXAMPLE]
  210.  
  211.  
  212. ──────────────────────────────────────────────────────────────────────────────
  213.  
  214.  
  215. [FUNCTION]
  216.  
  217. Procedure MyExitProc;
  218.  
  219. [PARAMETERS]
  220.  
  221. (None)
  222.  
  223. [RETURNS]
  224.  
  225. (None)
  226.  
  227. [DESCRIPTION]
  228.  
  229. The procedure begins the execution of the exit procedure stack.
  230. It also fixes for any other units that might do their own exit stack.
  231. In addition, if a breakpoint is set on the "ExitProc := SaveExitProc;"
  232. line, then you can Add a Watch of "SaveMaxAvail - MaxAvail" to see
  233. if any memory has not been deallocated - a bonus!
  234.  
  235. [SEE-ALSO]
  236.  
  237. [EXAMPLE]
  238.  
  239.